Skip to content

feat(api): make the AIP TypeScript SDK release-ready#4687

Merged
tothandras merged 5 commits into
mainfrom
feat/aip-sdk-release-readiness
Jul 13, 2026
Merged

feat(api): make the AIP TypeScript SDK release-ready#4687
tothandras merged 5 commits into
mainfrom
feat/aip-sdk-release-readiness

Conversation

@tothandras

@tothandras tothandras commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Summary

Implements the fixes from the @openmeter/client release-readiness review: correctness bugs in the generated SDK, emitter robustness, developer experience, packaging, and CI gates.

Correctness

  • toWire materializes required-with-default fields, so the minimal documented events.ingest() call carries specversion and is accepted by the server (previously always rejected with 400)
  • bigint (int64) request fields map to JSON numbers on the wire (typed UnsafeIntegerError beyond the JSON-safe range) and revive on responses — previously JSON.stringify crashed
  • the package root no longer shadows 18 operation request types with same-named domain models (ESM named exports beat export type *)
  • operations marked x-private/x-internal are omitted from the published SDK; they remain in the OpenAPI output for internal consumers

Emitter robustness

  • one shared isSuccessStatus resolver (was four divergent copies with different '*' semantics)
  • diagnostics reported on every silent-degradation path (z.any()/unknown fallbacks, operations dropped by grouping)
  • Code generated … DO NOT EDIT. headers on every emitted file
  • runtime templates are committed files under templates/ instead of base64 blobs generated from an out-of-repo baseline directory

Developer experience

  • JSDoc on every generated method/func (summary, description, HTTP route) and on …Input variant interfaces
  • named TypeSpec unions (Price, App, Charge, …) are exported, discriminator-narrowable types
  • auto-pagination companions (listAll) for page-number and cursor lists, backed by one shared runtime helper with a hard page cap
  • HTTPError carries name/invalidParameters/retryAfter; a User-Agent: openmeter-node/<version> header is sent, version stamped at publish
  • README documents transport configuration (including the POST-not-retried ingest caveat), runtime validation, the ./zod export, Result/unwrap, and pagination

Packaging & CI

  • LICENSE ships in the tarball; engines, caret dependency ranges, sideEffects: false, files allowlist, and main/types fallbacks added
  • the SDK conformance suite and emitter checks run in CI (make test-api-spec) and gate the npm publish workflow

Decisions for reviewers

  1. Internal operations removed from the SDK: excluding x-private/x-internal turned out to cover whole domains — invoices (all 4 ops), currencies + cost-bases, governance, and create-subscription-addon. The spec's own markers say these "should not be exposed to customers"; removing the markers in the spec is the knob if any were meant to be public.
  2. expires_at stays int64/bigint: an earlier iteration modeled it as utcDateTime with @encode(unixTimestamp) for Date DX, but that changed the public OpenAPI contract (format: int64format: unixtime); per adversarial review it was reverted to keep the contract byte-identical — the bigint wire mapping makes the field work correctly as-is.

Test plan

  • 354 SDK tests + 7 emitter tests green (make -C api/spec test)
  • make lint-api-spec green (prettier, spec lint, both tsconfig typechecks)
  • Generation idempotent; make update-openapi on this branch produces zero drift (CI generator gates pass)
  • go vet on the goverter converter package; api/v3/openapi.yaml and api/v3/api.gen.go are byte-identical to main
  • npm pack --dry-run: LICENSE + README + dist only, no dev artifacts

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added lazy listAll/<method>All async iteration across paginated resources, plus cursor/page safety via PaginationLimitExceededError.
    • Expanded top-level SDK surface with tax, features, llmCost, plans, addons, planAddons, and defaults; added listAll helpers across multiple sub-clients.
  • Bug Fixes
    • Improved SDK runtime for bigint conversion, required-with-default materialization, and richer HTTPError fields (including retryAfter).
  • Documentation
    • Refreshed README coverage for configuration, pagination, validation, and error handling.
  • Tests / CI
    • Strengthened CI and publish gating with API spec conformance tests; added pagination/wire/error/telemetry/exports test coverage.

Greptile Summary

This PR prepares the AIP TypeScript SDK for release. The main changes are:

  • Adds SDK conformance and emitter checks to CI and publish workflows.
  • Updates generated runtime handling for defaults, bigint fields, errors, telemetry, and pagination.
  • Splits public, internal, and private operation surfaces in the generated SDK.
  • Expands package exports, README content, tests, and npm packaging metadata.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.

Important Files Changed

Filename Overview
api/spec/packages/typespec-typescript/src/runtime/wire.ts Adds request-side default materialization and bigint conversion for generated SDK wire mapping.
api/spec/packages/typespec-typescript/templates/runtime/paginate.ts Adds shared async helpers for page-number and cursor pagination.
api/spec/packages/typespec-typescript/src/sdk-files.ts Generates pagination companions, internal facades, JSDoc, and safer package-root exports.
api/spec/packages/typespec-typescript/src/emitter.tsx Updates emission to split public and internal operations and stamp generated outputs.
api/spec/packages/aip-client-javascript/src/sdk/internal.ts Adds the generated internal SDK facade for operations kept off the public client surface.

Reviews (2): Last reviewed commit: "feat(api): emit x-internal operations un..." | Re-trigger Greptile

Context used (3)

  • Context used - CLAUDE.md (source)
  • Context used - AGENTS.md (source)
  • Context used - api/spec/AGENTS.md (source)

Implements the fixes from the @openmeter/client release-readiness
review.

Correctness:
- toWire materializes required-with-default fields, so the minimal
  documented events.ingest() call carries specversion and is accepted
- bigint (int64) request fields map to JSON numbers on the wire (typed
  UnsafeIntegerError beyond the JSON-safe range) and revive on responses
- the package root no longer shadows 18 operation request types with
  same-named domain models
- operations marked x-private/x-internal are omitted from the SDK
  (they remain in the OpenAPI output)

Emitter robustness:
- one shared isSuccessStatus resolver (was four divergent copies)
- diagnostics on every silent-degradation path (any/unknown fallbacks,
  ungrouped operations)
- generated-file headers on every emitted file
- runtime templates are committed files under templates/ instead of
  base64 blobs generated from an out-of-repo baseline

Developer experience:
- JSDoc on every generated method/func (summary, description, route)
  and on Input variant interfaces
- named TypeSpec unions (Price, App, Charge, ...) are exported,
  narrowable types
- auto-pagination companions (listAll) for page-number and cursor lists
  with a shared runtime helper and a hard page cap
- HTTPError carries name/invalidParameters/retryAfter; a User-Agent
  header is sent with the version stamped at publish
- README documents transport config, runtime validation, the ./zod
  export, Result/unwrap, and pagination

Packaging and CI:
- LICENSE ships in the tarball; engines, caret dependency ranges,
  sideEffects, files allowlist, and main/types fallbacks added
- the SDK conformance suite and emitter checks run in CI and gate the
  npm publish workflow
@tothandras
tothandras requested a review from a team as a code owner July 11, 2026 11:34
@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: ff618da1-4dcb-4937-87c6-68a37c7c62b9

📥 Commits

Reviewing files that changed from the base of the PR and between f322312 and a053b7a.

📒 Files selected for processing (5)
  • api/spec/AGENTS.md
  • api/spec/packages/typespec-typescript/package.json
  • api/spec/packages/typespec-typescript/src/emitter.tsx
  • api/spec/packages/typespec-typescript/test/emit.ts
  • api/spec/packages/typespec-typescript/test/internal-surface.test.ts
✅ Files skipped from review due to trivial changes (1)
  • api/spec/AGENTS.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • api/spec/packages/typespec-typescript/src/emitter.tsx

📝 Walkthrough

Walkthrough

The PR updates the TypeSpec JavaScript SDK generator and generated client with pagination companions, union-aware types, bigint/default wire mapping, typed errors, refreshed exports and documentation, plus conformance tests and CI/release gates.

Changes

Generated SDK and runtime

Layer / File(s) Summary
Generator contracts and emitted artifacts
api/spec/packages/typespec-typescript/src/*, api/spec/packages/typespec-typescript/templates/*
Adds visibility filtering, reachable named unions, pagination metadata, diagnostics, generated JSDoc, and committed runtime-template loading.
Runtime behavior and SDK surface
api/spec/packages/typespec-typescript/templates/runtime/*, api/spec/packages/aip-client-javascript/src/lib/*, api/spec/packages/aip-client-javascript/src/sdk/*
Adds pagination, bigint and default mapping, typed errors, request results, telemetry headers, public resource facades, and internal operations.
Models, exports, packaging, and documentation
api/spec/packages/aip-client-javascript/src/models/*, api/spec/packages/aip-client-javascript/src/index.ts, api/spec/packages/aip-client-javascript/package.json, api/spec/packages/aip-client-javascript/README.md
Updates generated aliases, operation exports, package metadata, published files, README sections, and generated-file markers.
Conformance and release validation
api/spec/packages/*/tests/*, .github/workflows/*, Makefile, api/spec/Makefile
Adds coverage for runtime, pagination, exports, routing, wire conversion, and errors, and runs the SDK test suite in CI and before npm publishing.

Estimated code review effort: 5 (Critical) | ~120 minutes

Possibly related PRs

Suggested labels: area/api, release-note/misc

Suggested reviewers: turip, chrisgacsal, solkimicreb

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and accurately summarizes the PR’s main goal of making the AIP TypeScript SDK release-ready.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/aip-sdk-release-readiness

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
api/spec/packages/aip-client-javascript/src/sdk/meters.ts (1)

150-156: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

queryCsv JSDoc is missing summary and description.

The coding guideline requires every emitted facade method to have JSDoc containing summary, differing description, and the HTTP route. The queryCsv JSDoc only has the route. Since this is generated output, the fix belongs in the emitter's JSDoc generation for CSV variant methods.

📄 Suggested JSDoc for queryCsv
-  /** POST /openmeter/meters/{meterId}/query */
+  /**
+   * Query meter (CSV)
+   *
+   * Query a meter for usage and download the result as a CSV file.
+   *
+   * POST /openmeter/meters/{meterId}/query
+   */
   async queryCsv(
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@api/spec/packages/aip-client-javascript/src/sdk/meters.ts` around lines 150 -
156, Update the emitter’s JSDoc generation for CSV variant methods so queryCsv
and equivalent emitted facade methods include a summary and distinct description
in addition to the existing HTTP route. Preserve the route and ensure the
generated documentation satisfies the standard required for all facade methods.

Source: Coding guidelines

api/spec/packages/typespec-typescript/src/runtime/wire.ts (1)

11-20: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Call defaultValue() here. requiredDefault() is returning the ZodDefault callback itself instead of the resolved value, so required-with-default fields can end up wrong on the wire. api/spec/packages/typespec-typescript/src/runtime/wire.ts:59-81

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@api/spec/packages/typespec-typescript/src/runtime/wire.ts` around lines 11 -
20, Update the required-default handling in the wire serialization logic around
requiredDefault so it invokes the ZodDefault defaultValue callback and uses its
resolved value, rather than returning the callback itself. Preserve the existing
behavior for fields without defaults.
🧹 Nitpick comments (4)
api/spec/packages/aip-client-javascript/src/funcs/tax.ts (1)

22-26: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Tax operation JSDoc blocks missing differing descriptions across funcs/tax.ts and sdk/tax.ts. The coding guideline requires every emitted facade method and standalone function to have "JSDoc containing summary, differing description, and the HTTP route." All tax JSDoc blocks include a summary and route but omit the differing description — likely because the TypeSpec source for tax operations lacks @doc annotations. Compare with apps operations which include descriptions like "List installed apps." and "Get an installed app." The listCodesAll facade method has the pagination note but is still missing the operation-level description that apps.listAll includes.

  • api/spec/packages/aip-client-javascript/src/funcs/tax.ts#L22-L26: Add @doc to the createTaxCode TypeSpec operation so the emitter generates a differing description.
  • api/spec/packages/aip-client-javascript/src/funcs/tax.ts#L49-L53: Same for getTaxCode.
  • api/spec/packages/aip-client-javascript/src/funcs/tax.ts#L78-L82: Same for listTaxCodes.
  • api/spec/packages/aip-client-javascript/src/funcs/tax.ts#L112-L116: Same for upsertTaxCode.
  • api/spec/packages/aip-client-javascript/src/funcs/tax.ts#L145-L149: Same for deleteTaxCode.
  • api/spec/packages/aip-client-javascript/src/sdk/tax.ts#L25-L100: Regenerate sdk/tax.ts after adding @doc annotations so all facade method JSDoc blocks (createCode, getCode, listCodes, listCodesAll, upsertCode, deleteCode) include the operation description.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@api/spec/packages/aip-client-javascript/src/funcs/tax.ts` around lines 22 -
26, Add distinct `@doc` descriptions to the TypeSpec operations createTaxCode,
getTaxCode, listTaxCodes, upsertTaxCode, and deleteTaxCode in
api/spec/packages/aip-client-javascript/src/funcs/tax.ts, preserving their
existing summaries and routes; then regenerate
api/spec/packages/aip-client-javascript/src/sdk/tax.ts so createCode, getCode,
listCodes, listCodesAll, upsertCode, and deleteCode include the emitted
operation descriptions, with listCodesAll retaining its pagination note.

Source: Coding guidelines

api/spec/packages/aip-client-javascript/src/funcs/meters.ts (1)

226-226: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

queryMeterCsv JSDoc is missing summary and description.

Every other standalone function in this file has a JSDoc with a summary, a differing description, and the HTTP route. queryMeterCsv only has the route. Per the coding guidelines, every emitted standalone function must have JSDoc containing all three. The fix would be in the emitter's JSDoc template, not in this generated file.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@api/spec/packages/aip-client-javascript/src/funcs/meters.ts` at line 226, The
emitter’s JSDoc template for queryMeterCsv must include a summary, description,
and HTTP route instead of emitting only the route. Update the template logic
generating standalone function documentation, preserving the existing route and
using the function’s available metadata for the summary and description.

Source: Coding guidelines

api/spec/packages/typespec-typescript/src/readme.ts (1)

154-227: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Consider documenting the vendored ky-specific option names.

The configuration section links to the mainline ky GitHub page and says SDKOptions extends ky's Options, but the SDK uses a vendored ky with specific option names (totalTimeout, retryOnTimeout) that differ from mainline ky. Users who follow the link to ky's docs may encounter option names that don't work with the vendored version. A brief note about the vendored option names would prevent confusion.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@api/spec/packages/typespec-typescript/src/readme.ts` around lines 154 - 227,
Update the configuration() documentation to note that the SDK uses a vendored ky
version with the option names totalTimeout and retryOnTimeout, which may differ
from the linked mainline ky documentation. Place the brief clarification near
the existing SDKOptions/ky Options description without changing the examples or
other configuration guidance.

Source: Coding guidelines

api/spec/packages/aip-client-javascript/src/models/types.ts (1)

2664-2682: 🚀 Performance & Scalability | 🔵 Trivial | 💤 Low value

Boolean/numeric filters weren't included in the alias consolidation.

Nice consolidation overall — string, stringExact, ulid, and datetime filters all now point at shared named aliases, but boolean and numeric here are still inline unions. If FieldFilters is meant to mirror the same filter-alias pattern used elsewhere in this file, worth checking whether the emitter should also emit BooleanFieldFilter/NumericFieldFilter aliases for consistency (this file is generated, so any fix would land in the emitter templates rather than here).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@api/spec/packages/aip-client-javascript/src/models/types.ts` around lines
2664 - 2682, Update the emitter templates that generate FieldFilters so boolean
and numeric use shared BooleanFieldFilter and NumericFieldFilter aliases,
matching the existing string, stringExact, ulid, and datetime filter aliases; do
not edit the generated types.ts output directly.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@api/spec/AGENTS.md`:
- Around line 49-54: Update the runtime-helper reference in AGENTS.md to point
from src/wire-runtime.ts to src/runtime/wire.ts, matching the documented source
location while preserving the surrounding guidance.

In `@api/spec/Makefile`:
- Line 56: Update the inline Node version-replacement command in the Makefile so
it verifies that the SDK_VERSION pattern in src/lib/version.ts matched before
writing the file. If no replacement occurs, throw an error and stop the publish
command; otherwise preserve the existing write behavior with the updated
AIP_SDK_RELEASE_VERSION value.

In `@api/spec/packages/aip-client-javascript/src/funcs/customers.ts`:
- Around line 50-54: The generated JSDoc for the listed customer operations
contains only summaries and routes; add distinct `@doc` descriptions in the
TypeSpec source for createCustomer, getCustomer, listCustomers, upsertCustomer,
deleteCustomer, getCustomerBilling, updateCustomerBilling,
updateCustomerBillingAppData, and createCustomerCharges, then regenerate both
funcs/customers.ts and sdk/customers.ts so every corresponding facade method and
standalone function includes a summary, differing description, and HTTP route.
Affected sites are
api/spec/packages/aip-client-javascript/src/funcs/customers.ts lines 50-54,
77-81, 106-110, 141-145, 174-178, 195-199, 224-228, 257-261, and 728-734, plus
api/spec/packages/aip-client-javascript/src/sdk/customers.ts lines 77-81, 89-93,
101-105, 131-135, 143-147, 174-178, 186-191, 198-202, and 504-510; these
generated sites require no direct edits.

---

Outside diff comments:
In `@api/spec/packages/aip-client-javascript/src/sdk/meters.ts`:
- Around line 150-156: Update the emitter’s JSDoc generation for CSV variant
methods so queryCsv and equivalent emitted facade methods include a summary and
distinct description in addition to the existing HTTP route. Preserve the route
and ensure the generated documentation satisfies the standard required for all
facade methods.

In `@api/spec/packages/typespec-typescript/src/runtime/wire.ts`:
- Around line 11-20: Update the required-default handling in the wire
serialization logic around requiredDefault so it invokes the ZodDefault
defaultValue callback and uses its resolved value, rather than returning the
callback itself. Preserve the existing behavior for fields without defaults.

---

Nitpick comments:
In `@api/spec/packages/aip-client-javascript/src/funcs/meters.ts`:
- Line 226: The emitter’s JSDoc template for queryMeterCsv must include a
summary, description, and HTTP route instead of emitting only the route. Update
the template logic generating standalone function documentation, preserving the
existing route and using the function’s available metadata for the summary and
description.

In `@api/spec/packages/aip-client-javascript/src/funcs/tax.ts`:
- Around line 22-26: Add distinct `@doc` descriptions to the TypeSpec operations
createTaxCode, getTaxCode, listTaxCodes, upsertTaxCode, and deleteTaxCode in
api/spec/packages/aip-client-javascript/src/funcs/tax.ts, preserving their
existing summaries and routes; then regenerate
api/spec/packages/aip-client-javascript/src/sdk/tax.ts so createCode, getCode,
listCodes, listCodesAll, upsertCode, and deleteCode include the emitted
operation descriptions, with listCodesAll retaining its pagination note.

In `@api/spec/packages/aip-client-javascript/src/models/types.ts`:
- Around line 2664-2682: Update the emitter templates that generate FieldFilters
so boolean and numeric use shared BooleanFieldFilter and NumericFieldFilter
aliases, matching the existing string, stringExact, ulid, and datetime filter
aliases; do not edit the generated types.ts output directly.

In `@api/spec/packages/typespec-typescript/src/readme.ts`:
- Around line 154-227: Update the configuration() documentation to note that the
SDK uses a vendored ky version with the option names totalTimeout and
retryOnTimeout, which may differ from the linked mainline ky documentation.
Place the brief clarification near the existing SDKOptions/ky Options
description without changing the examples or other configuration guidance.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 98756a0d-d633-4445-8a87-39bfe72e255a

📥 Commits

Reviewing files that changed from the base of the PR and between 12ab7b0 and 097553b.

⛔ Files ignored due to path filters (1)
  • api/spec/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (119)
  • .github/workflows/aip-npm-release.yaml
  • .github/workflows/ci.yaml
  • AGENTS.md
  • Makefile
  • api/spec/AGENTS.md
  • api/spec/Makefile
  • api/spec/packages/aip-client-javascript/.npmignore
  • api/spec/packages/aip-client-javascript/LICENSE
  • api/spec/packages/aip-client-javascript/README.md
  • api/spec/packages/aip-client-javascript/package.json
  • api/spec/packages/aip-client-javascript/src/core.ts
  • api/spec/packages/aip-client-javascript/src/funcs/addons.ts
  • api/spec/packages/aip-client-javascript/src/funcs/apps.ts
  • api/spec/packages/aip-client-javascript/src/funcs/billing.ts
  • api/spec/packages/aip-client-javascript/src/funcs/currencies.ts
  • api/spec/packages/aip-client-javascript/src/funcs/customers.ts
  • api/spec/packages/aip-client-javascript/src/funcs/defaults.ts
  • api/spec/packages/aip-client-javascript/src/funcs/entitlements.ts
  • api/spec/packages/aip-client-javascript/src/funcs/events.ts
  • api/spec/packages/aip-client-javascript/src/funcs/features.ts
  • api/spec/packages/aip-client-javascript/src/funcs/governance.ts
  • api/spec/packages/aip-client-javascript/src/funcs/index.ts
  • api/spec/packages/aip-client-javascript/src/funcs/invoices.ts
  • api/spec/packages/aip-client-javascript/src/funcs/llmCost.ts
  • api/spec/packages/aip-client-javascript/src/funcs/meters.ts
  • api/spec/packages/aip-client-javascript/src/funcs/planAddons.ts
  • api/spec/packages/aip-client-javascript/src/funcs/plans.ts
  • api/spec/packages/aip-client-javascript/src/funcs/subscriptions.ts
  • api/spec/packages/aip-client-javascript/src/funcs/tax.ts
  • api/spec/packages/aip-client-javascript/src/index.ts
  • api/spec/packages/aip-client-javascript/src/lib/config.ts
  • api/spec/packages/aip-client-javascript/src/lib/encodings.ts
  • api/spec/packages/aip-client-javascript/src/lib/paginate.ts
  • api/spec/packages/aip-client-javascript/src/lib/request.ts
  • api/spec/packages/aip-client-javascript/src/lib/to-error.ts
  • api/spec/packages/aip-client-javascript/src/lib/types.ts
  • api/spec/packages/aip-client-javascript/src/lib/version.ts
  • api/spec/packages/aip-client-javascript/src/lib/wire.ts
  • api/spec/packages/aip-client-javascript/src/models/errors.ts
  • api/spec/packages/aip-client-javascript/src/models/operations/addons.ts
  • api/spec/packages/aip-client-javascript/src/models/operations/apps.ts
  • api/spec/packages/aip-client-javascript/src/models/operations/billing.ts
  • api/spec/packages/aip-client-javascript/src/models/operations/currencies.ts
  • api/spec/packages/aip-client-javascript/src/models/operations/customers.ts
  • api/spec/packages/aip-client-javascript/src/models/operations/defaults.ts
  • api/spec/packages/aip-client-javascript/src/models/operations/entitlements.ts
  • api/spec/packages/aip-client-javascript/src/models/operations/events.ts
  • api/spec/packages/aip-client-javascript/src/models/operations/features.ts
  • api/spec/packages/aip-client-javascript/src/models/operations/governance.ts
  • api/spec/packages/aip-client-javascript/src/models/operations/invoices.ts
  • api/spec/packages/aip-client-javascript/src/models/operations/llmCost.ts
  • api/spec/packages/aip-client-javascript/src/models/operations/meters.ts
  • api/spec/packages/aip-client-javascript/src/models/operations/planAddons.ts
  • api/spec/packages/aip-client-javascript/src/models/operations/plans.ts
  • api/spec/packages/aip-client-javascript/src/models/operations/subscriptions.ts
  • api/spec/packages/aip-client-javascript/src/models/operations/tax.ts
  • api/spec/packages/aip-client-javascript/src/models/schemas.ts
  • api/spec/packages/aip-client-javascript/src/models/types.ts
  • api/spec/packages/aip-client-javascript/src/sdk/addons.ts
  • api/spec/packages/aip-client-javascript/src/sdk/apps.ts
  • api/spec/packages/aip-client-javascript/src/sdk/billing.ts
  • api/spec/packages/aip-client-javascript/src/sdk/currencies.ts
  • api/spec/packages/aip-client-javascript/src/sdk/customers.ts
  • api/spec/packages/aip-client-javascript/src/sdk/defaults.ts
  • api/spec/packages/aip-client-javascript/src/sdk/entitlements.ts
  • api/spec/packages/aip-client-javascript/src/sdk/events.ts
  • api/spec/packages/aip-client-javascript/src/sdk/features.ts
  • api/spec/packages/aip-client-javascript/src/sdk/governance.ts
  • api/spec/packages/aip-client-javascript/src/sdk/invoices.ts
  • api/spec/packages/aip-client-javascript/src/sdk/llmCost.ts
  • api/spec/packages/aip-client-javascript/src/sdk/meters.ts
  • api/spec/packages/aip-client-javascript/src/sdk/planAddons.ts
  • api/spec/packages/aip-client-javascript/src/sdk/plans.ts
  • api/spec/packages/aip-client-javascript/src/sdk/sdk.ts
  • api/spec/packages/aip-client-javascript/src/sdk/subscriptions.ts
  • api/spec/packages/aip-client-javascript/src/sdk/tax.ts
  • api/spec/packages/aip-client-javascript/tests/client.spec.ts
  • api/spec/packages/aip-client-javascript/tests/errors.spec.ts
  • api/spec/packages/aip-client-javascript/tests/index-exports.spec.ts
  • api/spec/packages/aip-client-javascript/tests/meters.spec.ts
  • api/spec/packages/aip-client-javascript/tests/nesting.spec.ts
  • api/spec/packages/aip-client-javascript/tests/paginate.spec.ts
  • api/spec/packages/aip-client-javascript/tests/wire-helpers.ts
  • api/spec/packages/aip-client-javascript/tests/wire.spec.ts
  • api/spec/packages/aip-client-javascript/tsconfig.json
  • api/spec/packages/aip-client-javascript/vitest.config.ts
  • api/spec/packages/aip/tspconfig.yaml
  • api/spec/packages/typespec-typescript/scripts/gen-runtime-templates.mjs
  • api/spec/packages/typespec-typescript/src/ZodOperations.tsx
  • api/spec/packages/typespec-typescript/src/casing-gate.ts
  • api/spec/packages/typespec-typescript/src/emitter.tsx
  • api/spec/packages/typespec-typescript/src/http-status.ts
  • api/spec/packages/typespec-typescript/src/input-variants.ts
  • api/spec/packages/typespec-typescript/src/interface-types.ts
  • api/spec/packages/typespec-typescript/src/lib.ts
  • api/spec/packages/typespec-typescript/src/pagination.ts
  • api/spec/packages/typespec-typescript/src/readme.ts
  • api/spec/packages/typespec-typescript/src/runtime-templates.ts
  • api/spec/packages/typespec-typescript/src/runtime/wire.ts
  • api/spec/packages/typespec-typescript/src/sdk-files.ts
  • api/spec/packages/typespec-typescript/src/sdk-operations.ts
  • api/spec/packages/typespec-typescript/src/ts-types.ts
  • api/spec/packages/typespec-typescript/src/utils.tsx
  • api/spec/packages/typespec-typescript/src/visibility.ts
  • api/spec/packages/typespec-typescript/src/zodBaseSchema.tsx
  • api/spec/packages/typespec-typescript/templates/runtime/config.ts
  • api/spec/packages/typespec-typescript/templates/runtime/core.ts
  • api/spec/packages/typespec-typescript/templates/runtime/encodings.ts
  • api/spec/packages/typespec-typescript/templates/runtime/errors.ts
  • api/spec/packages/typespec-typescript/templates/runtime/paginate.ts
  • api/spec/packages/typespec-typescript/templates/runtime/request.ts
  • api/spec/packages/typespec-typescript/templates/runtime/to-error.ts
  • api/spec/packages/typespec-typescript/templates/runtime/types.ts
  • api/spec/packages/typespec-typescript/templates/runtime/version.ts
  • api/spec/packages/typespec-typescript/templates/tests/client.spec.ts
  • api/spec/packages/typespec-typescript/templates/tests/errors.spec.ts
  • api/spec/packages/typespec-typescript/templates/tests/meters.spec.ts
  • api/spec/packages/typespec-typescript/templates/tests/nesting.spec.ts
  • api/spec/packages/typespec-typescript/vitest.config.ts
💤 Files with no reviewable changes (12)
  • api/spec/packages/aip-client-javascript/.npmignore
  • api/spec/packages/aip-client-javascript/src/sdk/governance.ts
  • api/spec/packages/aip-client-javascript/src/funcs/currencies.ts
  • api/spec/packages/aip-client-javascript/src/funcs/governance.ts
  • api/spec/packages/aip-client-javascript/src/sdk/currencies.ts
  • api/spec/packages/aip-client-javascript/src/sdk/invoices.ts
  • api/spec/packages/aip-client-javascript/tsconfig.json
  • api/spec/packages/typespec-typescript/scripts/gen-runtime-templates.mjs
  • api/spec/packages/aip-client-javascript/src/models/operations/invoices.ts
  • api/spec/packages/aip-client-javascript/src/funcs/invoices.ts
  • api/spec/packages/aip-client-javascript/src/models/operations/currencies.ts
  • api/spec/packages/aip-client-javascript/src/models/operations/governance.ts

Comment thread api/spec/AGENTS.md
Comment thread api/spec/Makefile Outdated
Comment thread api/spec/packages/aip-client-javascript/src/funcs/customers.ts
@tothandras tothandras added the release-note/feature Release note: Exciting New Features label Jul 11, 2026
Review follow-up: the publish-time SDK_VERSION rewrite silently
no-opped if the version.ts format drifted, publishing a stale version
in the User-Agent header. Also clarify in AGENTS.md that a missing
JSDoc description on a generated method is a spec-authoring gap, not
an emitter bug.
@tothandras

Copy link
Copy Markdown
Contributor Author

@greptile-apps

… SDK

Operations marked x-internal (without x-private) in the TypeSpec source
were omitted from the generated TypeScript SDK entirely. They are now
emitted but quarantined under client.internal.<group>.<method>: a new
src/sdk/internal.ts holds an Internal aggregate with Internal<Group>
facade classes, while internal operations share their group's funcs/ and
models/operations/ modules with the public surface. A group whose
operations are all internal (currencies) gets no public facade or getter,
and the Internal class is not re-exported at the package root (the name
belongs to the Internal Server Error model). x-private operations remain
fully omitted.

The README gains an Internal Operations section, and a fifth generated
conformance test (tests/internal.spec.ts) pins the internal routing and
the public-surface quarantine. Newly surfaced operations:
create-subscription-addon, list-currencies, create-custom-currency,
list-cost-bases, create-cost-basis.
@tothandras

Copy link
Copy Markdown
Contributor Author

@greptile-apps

writeOutput returns a promise the emitter never awaited, so $onEmit
resolved before the generated files landed on the host. The tsp CLI
masks the race because the process outlives the pending writes, but
in-memory compilation (the emitter test harness) observes a partially
written output directory.
The emitter previously had no way to test generator behavior before
regenerating the real client: the conformance specs run against the
committed aip-client-javascript output only. test/emit.ts builds an
EmitterTester (createTester from @typespec/compiler/testing) that
compiles a fixture spec in-memory, runs the built emitter through the
compiler's real emit pipeline, and returns the emitted files for
assertion. test/internal-surface.test.ts uses it to pin the
customer-visibility partitioning: x-private operations are dropped
(alone or combined with x-internal), x-internal operations are
quarantined under client.internal.* with pagination companions,
entirely-internal groups get no public facade or getter, funcs and
operation envelope modules are shared between surfaces, and the README
documents the internal section.

The package test script now builds first, since the tester resolves the
emitter through its package.json entry point (dist/). The harness runs
in CI via make -C api/spec test in the aip-npm-release workflow.
@greptile-apps

greptile-apps Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Too many files changed for review. (126 files found, 100 file limit)

Bypass the limit by tagging @greptile-apps to review.

@tothandras
tothandras enabled auto-merge (squash) July 13, 2026 08:43
@tothandras
tothandras merged commit e7a04be into main Jul 13, 2026
29 checks passed
@tothandras
tothandras deleted the feat/aip-sdk-release-readiness branch July 13, 2026 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-note/feature Release note: Exciting New Features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants